package com.qf.controller;

import com.qf.common.vo.R;
import com.qf.entity.Type;
import com.qf.service.intf.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: cool新闻
 * @author: No1
 * @create: 2020-11-30 11:33:07
 */
@RestController
@RequestMapping("/api/type")
public class TypeController {
    @Autowired
    private TypeService typeService;
    //新增
    @PostMapping("/add.do")
    public R save(@RequestBody Type type){
        return typeService.save(type);
    }
    //删除
    @DeleteMapping("/del.do")
    public R del(int id){
        return typeService.delById(id);
    }
    //查询
    @GetMapping("/all.do")
    public R all(){
        return typeService.all();
    }
}